package com.xiaoshuidi.cloud.framework.pay.core.client.impl.tonglian;

import com.xiaoshuidi.cloud.framework.common.exception.ErrorCode;
import com.xiaoshuidi.cloud.framework.common.exception.enums.GlobalErrorCodeConstants;
import com.xiaoshuidi.cloud.framework.pay.core.client.AbstractPayCodeMapping;
import com.xiaoshuidi.cloud.framework.pay.core.enums.PayFrameworkErrorCodeConstants;

/**
 * 通联支付 PayCodeMapping 实现类
 */
public class TonglianCodeMapping extends AbstractPayCodeMapping {
    @Override
    protected ErrorCode apply0(String apiCode, String apiMsg) {
        switch (apiCode) {
            case "SUCCESS":
            case "success":
                return GlobalErrorCodeConstants.SUCCESS;
            case "FAIL":
            case "fail":
                return PayFrameworkErrorCodeConstants.PAY_EXCEPTION;
        }
        return null;
    }
}
